﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KPIS.GERP.Models
{
    public class salary_promote
    {
        public int sp_seq { get; set; }
        public string sp_cmd_title { get; set; }
        public DateTime? effected_date { get; set; }  
        public string remarks { get; set; }

        public string record_status { get; set; }
        public int? created_by { get; set; }
        public DateTime? created_when { get; set; }
        public int? updated_by { get; set; }
        public DateTime? updated_when { get; set; }

        public string RemarksWord
        {
            get { return remarks.Substring(0, remarks.Length < 100 ? remarks.Length : 100); }
        }
        public string EffectedDateWord
        {
            get { return effected_date.HasValue ? effected_date.Value.ToString("d MMMM yyyy") : ""; }
        }
        public string StatusWord
        {
            get {
                switch (record_status)
                {
                    case "W":
                        return "ยังไม่ส่งขออนุมัติ";
                    case "P":
                        return "อยู่ระหว่างการขออนุมัติ";
                    case "A":
                        return "ได้รับการอนุมัติ";
                    case "C":
                        return "ถูกยกเลิกหรือตีกลับ";
                    case "U":
                        return "มีผลบังคับใช้";
                    default:
                        return "?";
                }
            }
        }
         
        public List<salary_promote_detail> Details { get; set; } 
    }

    //public class salary_promote_detail
    //{
    //    public int sp_seq { get; set; }
    //    public int spd_seq { get; set; }
    //    public int pos_seq { get; set; }
    //    public int emp_seq { get; set; } 
    //    public decimal old_salary { get; set; }
    //    public decimal new_salary { get; set; }  
    //    public hrm_mp_positions Position { get; set; }
    //    public hrm_ps_employees Employee { get; set; }

    //}
}
